package com.vhall.component.service.room;

import com.alibaba.fastjson.JSONObject;
import com.vhall.component.entity.rebroadcast.RebroadCastEntity;
import com.vhall.component.entity.room.dto.RoomWatermarkDTO;
import com.vhall.component.entity.room.dto.RoomsEntityDTO;
import com.vhall.component.entity.room.entity.RoomExtendsEntity;
import com.vhall.component.entity.room.entity.RoomsEntity;
import com.vhall.component.entity.room.vo.*;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author guoxin.wang
 * @date 2021/7/12 17:30
 */
@Service
public interface RoomService {

    /**
     * 获取房间信息
     *
     * @param reqVO
     * @return
     */
    RoomAttrRespVO getAttributes(RoomAttrVO reqVO);

    /**
     * 获取房间扩展信息
     *
     * @param reqVO
     * @return
     */
    RoomExtendRespVO getRoomExtendsInfo(RoomAttrVO reqVO);

    /**
     * 开始直播
     *
     * @param reqVO
     * @return
     */
    Boolean startLive(StartLiveVO reqVO);

    /**
     * 房间结束
     *
     * @param reqVO
     * @return
     */
    Boolean endLive(EndLiveVO reqVO);

    /**
     * 房间结束的主方法
     * @param roomId
     * @param roomsEntityDTO
     * @param thirdPartyUserId
     * @return
     */
    Boolean endLiveMain(String roomId,  RoomsEntityDTO roomsEntityDTO, Integer thirdPartyUserId);

    /**
     * 删除房间信息
     *
     * @param reqVO
     * @return
     */
    List<String> delete(DelRoomVO reqVO);

    /**
     * 获取房间详细信息
     *
     * @param reqVO
     * @return
     */
    RoomDetailRespVO getRoomDetail(RoomAttrVO reqVO);

    /**
     * 根据roomid获取房间信息
     *
     * @param roomId
     * @return
     */
    RoomsEntity getRoomByRoomId(String roomId);

    /**
     * 主持人状态广播
     *
     * @param reqVO
     * @return
     */
    Boolean masterStatusNotice(MasterStatusNoticeVO reqVO);

    /**
     * 检查房间是否可以开播
     * @param roomsEntityDTO
     */
    void checkRoomLiveStartAudit(RoomsEntityDTO roomsEntityDTO);

    /**
     * 自定义菜单list
     *
     * @param reqVO
     * @return
     */
    JSONObject listCustomMenu(CustomMenuListVO reqVO);

    /**
     * 检查是否是主持人
     *
     * @param currAccountId 当前用户id
     * @param roomId        房间id
     * @return 1=是 0=否
     * @author yuanzh
     */
    Integer checkIsAnchor(Integer currAccountId, String roomId);

    /**
     * 缓存并处理获取活动转播拉流记录(加锁)
     *
     * @param roomId 房间号
     * @return 活动转播拉流记录
     */
    RebroadCastEntity cacheAndHandleGetRebroad(String roomId, String cacheKey);

    /**
     * 缓存并处理获取房间扩展信息(加锁)
     *
     * @param roomId 房间号
     * @return 房间扩展信息
     */
    RoomExtendsEntity cacheAndHandleGetRoomExtend(String roomId, String cacheKey);


    /**
     * 提交点播转直播任务
     *
     * @param reqVO
     * @return
     */
    JSONObject submitVODToLive(SubmitVODToLiveVO reqVO);

    /**
     * 获取流状态
     *
     * @param roomIds 请求参数
     */
    JSONObject getStreamStatus(String roomIds);

    /**
     * 通过水印模板获取水印信息
     *
     * @param watermarkTempId 水印模板 id
     * @return 水印信息
     */
    RoomWatermarkDTO getRoomWatermark(Integer watermarkTempId);

    Boolean genDefaultRecord(EndLiveVO reqVO);

    Boolean reservationOrNot(ReservationVO reservationVO);

    ReportRoomRspVO reportRoom(ReportRoomReqVO vo);

    List<ReportConfigRspVO>  getReportConfigList(ReportConfigReqVO vo);

    Boolean judgeReservationOrNot(CheckIsAnchorReqVO reservationVO);

    String getHaveSDKVersion();

    Boolean settingHaveSDKVersion(String version);

    RoomLimitTypeRspVO getLimitType(String roomId);

    RiskWarningSmallVO getRoomRiskWarning(String roomId);

    /**
     * 观看校验
     * @param vo
     * @return
     */
    LiveWatchCheckResponseVO liveWatchCheck(LiveWatchCheckRequestVO vo);
    Boolean setBeautyCoefficient(@RequestParam Integer number);

    /**
     * 查询美颜数值
     * @return
     */
    Integer getBeautyCoefficient();

    Long getVirtualPV(Integer ilId);
}
